<extend name="Public/base"/>
<block name="content">
<h3 class="col-md-8">权限管理</h3>
<div class="row">
    <div class="col-lg-12">
    	<div class="panel panel-default">
       		<div class="panel-heading ">
       			<div class="row">
       				<div class="col-lg-6">		
       					<ul class="nav nav-pills col-lg-12">
                           <li class="active"><a data-toggle="tab" href="#admin">管理组</a>
                           </li>
                           <!--li class=""><a data-toggle="tab" href="#home">用户组</a>
                           </li-->
	            		</ul>
	       			</div>
	       			<div class="col-lg-6">
	       				<div class="btn-group pull-right">
	        				<a id="add-group" class="btn btn-labeled btn-success" href="<{:U('createGroup')}>">新增</a>
	        				<a url="<{:U('changestatus',array('method'=>'deleteGroup'))}>" class="btn btn-labeled btn-danger ajax-post confirm" target-form="ids">删除</a>
	        				<a url="<{:U('changestatus',array('method'=>'resumeGroup'))}>" class="btn btn-labeled btn-success ajax-post" target-form="ids">启用</a>
	        				<a url="<{:U('changestatus',array('method'=>'forbidGroup'))}>" class="btn btn-labeled btn-danger ajax-post" target-form="ids">禁用</a>
		         		</div>
		         	</div>
	         	</div>      			
       		</div>
    		<div class="table-responsive">
    			<div class="tab-content p0 b0">
				<div id="admin" class="tab-pane fade active in">
	    			<table class="table table-striped table-bordered table-hover"> 
	            		<thead>
	               		 <tr>
	        				<th style="width: 5%" class="check-all">
	                        	<div data-toggle="tooltip" data-title="全选" class="checkbox c-checkbox">
	                         		<label>
	                            		<input type="checkbox">
	                            		<span class="fa fa-check"></span>
	                         		</label>
	                      		</div>
	                        </th>
	        				<th>用户组</th>
	        				<th>描述</th>
	        				<th>授权</th>
	        				<th>状态</th>
	        				<th class='text-center'>操作</th>
	        				</tr>
	            		</thead>
	            		<tbody>
	        			<notempty name="_list">
	        			<volist name="_list" id="vo">
	        			<if condition="$vo.module eq 'admin' ">
	        			<tr>
	                    	<td>
	                        	<div class="checkbox c-checkbox">
	                        		<label>
	                            		<input type="checkbox" class="ids" value="<{vo.id}>" name="id[]">
	                            		<span class="fa fa-check"></span>
	                         		</label>
	                      		</div>
	                      	</td>
	        				<td><a href="<{:U('AuthManager/editgroup?id='.$vo['id'])}>"><{$vo.title}></a> </td>
	        				<td><span><{:mb_strimwidth($vo['description'],0,60,"...","utf-8")}></span></td>
	        				<td>
	        					<a href="<{:U('AuthManager/access?group_name='.$vo['title'].'&group_id='.$vo['id'])}>" >访问授权</a>
	        					<!--a href="<{:U('AuthManager/category?group_name='.$vo['title'].'&group_id='.$vo['id'])}>" >分类授权</a-->
	        					<a href="<{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}>" >成员授权</a>
	        				</td>
	        				<td><{$vo.status_text}></td>
	        				<td class='text-center'><eq name="vo.status" value="1">
	        					<a href="<{:U('AuthManager/changeStatus?method=forbidGroup&id='.$vo['id'])}>" class="btn btn-labeled btn-sm btn-danger ajax-get">禁用</a>
	        					<else/>
	        					<a href="<{:U('AuthManager/changeStatus?method=resumeGroup&id='.$vo['id'])}>" class="btn btn-labeled btn-sm btn-success ajax-get">启用</a>
	        					</eq>
	        					<a href="<{:U('AuthManager/editgroup?id='.$vo['id'])}>" class="btn btn-labeled btn-sm">编辑</a>
	        					<a href="<{:U('AuthManager/changeStatus?method=deleteGroup'.$vo['id'])}>" class="btn btn-labeled btn-sm btn-danger confirm ajax-get">删除</a>
	                        </td>
	        			</tr>
	        			</if>
	        			</volist>
	        			<else/>
	        			<td colspan="6" class="text-center">暂时还没有内容! </td>
	        			</notempty>
	        			</tbody>
	            	</table>
     			</div>
				<div id="home" class="tab-pane fade">
	    			<table class="table table-striped table-bordered table-hover"> 
	            		<thead>
	               		 <tr>
	        				<th style="width: 5%" class="check-all">
	                        	<div data-toggle="tooltip" data-title="全选" class="checkbox c-checkbox">
	                         		<label>
	                            		<input type="checkbox">
	                            		<span class="fa fa-check"></span>
	                         		</label>
	                      		</div>
	                        </th>
	        				<th>用户组</th>
	        				<th>描述</th>
	        				<th>授权</th>
	        				<th>状态</th>
	        				<th class='text-center'>操作</th>
	        				</tr>
	            		</thead>
	            		<tbody>
	        			<notempty name="_list">
	        			<volist name="_list" id="vo">
	        			<if condition="$vo.module eq 'home' ">
	        			<tr>
	                    	<td>
	                        	<div class="checkbox c-checkbox">
	                        		<label>
	                            		<input type="checkbox" class="ids" value="<{vo.id}>" name="id[]">
	                            		<span class="fa fa-check"></span>
	                         		</label>
	                      		</div>
	                      	</td>
	        				<td><a href="<{:U('AuthManager/editgroup?id='.$vo['id'])}>"><{$vo.title}></a> </td>
	        				<td><span><{:mb_strimwidth($vo['description'],0,60,"...","utf-8")}></span></td>
	        				<td>
	        					<a href="<{:U('AuthManager/access?group_name='.$vo['title'].'&group_id='.$vo['id'])}>" >访问授权</a>
	        					<!--a href="<{:U('AuthManager/category?group_name='.$vo['title'].'&group_id='.$vo['id'])}>" >分类授权</a-->
	        					<a href="<{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}>" >成员授权</a>
	        				</td>
	        				<td><{$vo.status_text}></td>
	        				<td class='text-center'><eq name="vo.status" value="1">
	        					<a href="<{:U('AuthManager/changeStatus?method=forbidGroup&id='.$vo['id'])}>" class="btn btn-labeled btn-sm btn-danger ajax-get">禁用</a>
	        					<else/>
	        					<a href="<{:U('AuthManager/changeStatus?method=resumeGroup&id='.$vo['id'])}>" class="btn btn-labeled btn-sm btn-success ajax-get">启用</a>
	        					</eq>
	        					<a href="<{:U('AuthManager/editgroup?id='.$vo['id'])}>" class="btn btn-labeled btn-sm">编辑</a>
	        					<a href="<{:U('AuthManager/changeStatus?method=deleteGroup'.$vo['id'])}>" class="btn btn-labeled btn-sm btn-danger confirm ajax-get">删除</a>
	                        </td>
	        			</tr>
	        			</if>
	        			</volist>
	        			<else/>
	        			<td colspan="6" class="text-center">暂时还没有内容! </td>
	        			</notempty>
	        			</tbody>
	            	</table>
     			</div>     			
     				     			
     			</div>
     		</div>
    		<!-- 结束 表格 -->
    		<div class="panel-footer">
    			<div class="row">
					<ul class="pagination">
					<{$_page}>
					</ul>
				 </div>
            </div>    		
    	</div>
	</div>
</div>
</block>

<block name="script">
<script type="text/javascript" charset="utf-8">
highlight_subnav("<{:U('User/index')}>","<{:U('AuthManager/index')}>");
</script>
</block>
